package com.uroad.jilinpda.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;


import com.uroad.jilinpda.R;
import com.uroad.jilinpda.common.BaseActivity;
import com.uroad.jilinpda.common.GlobalData;
import com.uroad.jilinpda.util.UIUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.jzvd.JzvdStd;

/**
 * @创建者 wlw
 * @创建时间 2019/6/3 12:17
 * @描述
 */
public class OBUActivationStep3Activity extends BaseActivity {
    @BindView(R.id.ivTrips)
    ImageView ivTrips;
    @BindView(R.id.iv_ring2)
    ImageView iv_ring2;
    @BindView(R.id.tv_step2)
    TextView tv_step2;
    @BindView(R.id.view_lien2)
    View lien2;
    @BindView(R.id.llvideo)
    LinearLayout llvideo;
    @BindView(R.id.videoTrips)
    JzvdStd videoTrips;
    private String vehtype = "";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setBaseContentLayout(R.layout.activity_obu_activation_step_3);
        ButterKnife.bind(this);
        setTitle("标签激活");
        initView();
//        initVedioView();
    }
    private void initVedioView() {
        videoTrips.setUp(GlobalData.obu_activation_video_url_3, "");
        videoTrips.backButton.setVisibility(View.GONE);
    }

    @Override
    protected void onResume() {
        super.onResume();
//        videoTrips.startVideo();
    }

    @Override
    protected void onPause() {
        super.onPause();
//        Jzvd.resetAllVideos();
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
//        if (Jzvd.backPress()) {
//            return;
//        }
    }

    private void initView() {
        UIUtils.setViewScale(ivTrips, 670, 376);
//        UIUtils.setViewScale(llvideo, 670, 376);
        Bundle bundle = getIntent().getExtras();
        if (bundle != null) {
            String isneedpic = bundle.getString("isneedpic");
            vehtype = bundle.getString("vehtype");
            if ("0".equalsIgnoreCase(isneedpic)) {
                iv_ring2.setVisibility(View.GONE);
                lien2.setVisibility(View.GONE);
                tv_step2.setVisibility(View.GONE);
            }
        }
    }

    @OnClick({R.id.btnNext3})
    public void onClick(View view) {
        Bundle bundle = getIntent().getExtras();
//        if (!vehtype.equals("")&&vehtype.equals("1"))
            openActivity(ETCActivation58GActivity.class, bundle);
//        else if(!vehtype.equals("")&&vehtype.equals("2"))
           // openActivity(ETCTruckActivationActivity.class, bundle);
    }
}
